package web_model

import (
	"time"

	"gorm.io/gorm"
)

const TableNameSysUser = "sys_user"

// SysUser mapped from table <sys_user>
type SysUser struct {
	ID             int64          `gorm:"column:id;type:integer;primaryKey" json:"id"`
	TenantID       int64          `gorm:"column:tenant_id;type:integer" json:"tenant_id"`
	Username       string         `gorm:"column:username;type:text(128)" json:"username"`
	Realname       string         `gorm:"column:realname;type:text(64)" json:"realname"`
	Nickname       string         `gorm:"column:nickname;type:text(64)" json:"nickname"`
	Password       string         `gorm:"column:password;type:text(255)" json:"password"`
	Phone          string         `gorm:"column:phone;type:text(32)" json:"phone"`
	Avatar         string         `gorm:"column:avatar;type:text(255)" json:"avatar"`
	ClientID       string         `gorm:"column:client_id;type:text(128)" json:"client_id"`
	OpenID         string         `gorm:"column:open_id;type:text(128)" json:"open_id"`
	Status         string         `gorm:"column:status;type:text(1)" json:"status"`
	Desc           string         `gorm:"column:desc;type:text(255)" json:"desc"`
	Sort           int64          `gorm:"column:sort;type:integer" json:"sort"`
	Birthday       string         `gorm:"column:birthday;type:text(64)" json:"birthday"`
	OnboardingDate string         `gorm:"column:onboarding_date;type:text(64)" json:"onboarding_date"`
	Sex            string         `gorm:"column:sex;type:text(1)" json:"sex"`
	CreatedBy      string         `gorm:"column:created_by;type:text(20)" json:"created_by"`
	UpdatedBy      string         `gorm:"column:updated_by;type:text(20)" json:"updated_by"`
	CreatedAt      time.Time      `gorm:"column:created_at;type:DATETIME" json:"created_at"`
	UpdatedAt      time.Time      `gorm:"column:updated_at;type:DATETIME" json:"updated_at"`
	DeletedAt      gorm.DeletedAt `gorm:"column:deleted_at;type:DATETIME" json:"deleted_at"`
	Brand          string         `gorm:"column:brand;type:text(128)" json:"brand"`
	Model          string         `gorm:"column:model;type:text(128)" json:"model"`
}

// TableName SysUser's table name
func (*SysUser) TableName() string {
	return TableNameSysUser
}
